| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
Core
Description
The coreModule is the core of the Programm, it handles core functionality. this functionallity is in reading file indexes of directories, comapring the files read, and deleting or moving files. to be more concrete, the core reads (and filters) a directory containing so called jpeg files and one containing so called raw files then it comapares the two lists (jpeg list and raw list). in order to find all raw files, that have no matching jpeg file. (called differences) in the last step, the core, depending on the settings, deletes or moves all differences. Info: For simplicitie's sake the files matching the rawEnding of the settings are calleds raw files and the files matching the jpegEnding are called jpeg files even they could have any ending and could be files of any type.
- data PhotoSetting = PhotoSetting {}
- data PhotoFile = PhotoFile {}
- loadAndGetDifference :: PhotoSetting -> IO [PhotoFile]
- deleteDifferenceFiles :: PhotoSetting -> IO [PhotoFile]
- moveDifferenceFilesToBin :: PhotoSetting -> IO [PhotoFile]
- toPhotoFile :: FilePath -> PhotoFile
- concatFilePath :: PhotoFile -> FilePath
- getFilepathsFromPhotoFiles :: [PhotoFile] -> [FilePath]
- addPathToPhotoFiles :: [PhotoFile] -> FilePath -> [PhotoFile]
Documentation
data PhotoSetting Source #
data PhotoSetting PhotoSetting is a Data structure, that reprensents parameters which have to be set, bevore the Programm can do its job.
Constructors
| PhotoSetting | |
Fields
| |
Instances
| Eq PhotoSetting Source # | |
| Show PhotoSetting Source # | this instance of show, formats the Photosettings String to make it appear more beautiful. |
data PhotoFile This data represents a Photo File, or generally spoken a File.
Constructors
| PhotoFile | |
Arguments
| :: PhotoSetting | the PhotoSettings, containing all relevant paths. |
| -> IO [PhotoFile] | a List of "Raw" PhotoFiles, which have not counterpart in the Jpeg File list. |
loadAndGetDifference receives PhotoSettings. at first it load both, in the settings specified paths (rawPath and jpegPath) then it creates PhotoFiles out of the FileLists and filters them, using the raw- and jpegending, also specified in the settings. then it compares both lists, and returns a list of all "Raw Files", that have no counterpart in the "Jpeg Files" list.
deleteDifferenceFiles Source #
Arguments
| :: PhotoSetting | PhotoSettings, containing the relevant Paths and extensions. |
| -> IO [PhotoFile] | A List of PhotoFiles, that have been deleted. |
deleteDifferenceFiles gets some PhotoSettings. At first it loads from the specific paths, and calculates the Raw Files, wich have no counterpart in the Jpeg List then it deletes the calculated Raw Files.
moveDifferenceFilesToBin Source #
Arguments
| :: PhotoSetting | PhotoSettings, containing the relevant Paths and extensions. |
| -> IO [PhotoFile] | a List of PhotoFiles, that have been moved to the binPath. |
moveDifferenceFilesToBin gets some PhotoSettings. At first it loads from the specific paths, and calculates the Raw Files, wich have no counterpart in the Jpeg List then it moves the calculated Raw Files into the specified binPath
Arguments
| :: FilePath | a FilePath containing the Path, a Filename and a File extension. |
| -> PhotoFile | a PhotoFile Representation generated from the Path. |
toPhotoFiles gets a FilePath aka String, which contains the Path, the Filename and the fileextension. then it cuts the Path in three Parts and returns a PhotoFile.
concatFilePath is the reverse function of toPhotoFile. It needs a PhotoFile, and concats its part to a fully qualified FilePath, with path, filename and file extension.
getFilepathsFromPhotoFiles Source #
Arguments
| :: [PhotoFile] | a list of Photofiles, which are needed the FilePaths from |
| -> [FilePath] | the list of FilePaths, made out of the list of PhotoFiles. |
getFilepathsFromPhotofile gets a list of Photofiles, and produces a list of FilePaths out of it.
Arguments
| :: [PhotoFile] | a list of PhotoFiles, where the path sould be set. |
| -> FilePath | a path to set as path of all Photofiles in the list. |
| -> [PhotoFile] | a list of Photofiles with the specified path set. |
addPathToPhotoFiles gets a list of Photofiles and a FilePath, and sets the specified path as path of any photoFile in the list. its like an giant "setter" setting the same attribute in all objects in the list aka produces a new list with the path as path of each listitem.